#!/bin/dash
while true
do
	if [ $(cat /sys/class/power_supply/BAT0/capacity) -lt 20 ] && [ "$(cat /sys/class/power_supply/BAT0/status)" = "Discharging" ]; then
		notify-send "WARNING!" "Battery level low: $(cat /sys/class/power_supply/BAT0/capacity)%"
	fi
	sleep 300
done
